package at.ac.univie.ise;

import static at.ac.univie.ise.schema.Tables.CITY;

import java.sql.Connection;
import java.sql.SQLException;

import org.jooq.util.mysql.MySQLFactory;

import at.ac.univie.ise.common.Constants;
import at.ac.univie.ise.common.DBAccess;
import at.ac.univie.ise.schema.tables.records.CityRecord;

public class Test {
	
	public static void main(String[] args) throws SQLException {
		DBAccess db = new DBAccess(Constants.DB_PROP_FILE);
		Connection conn = db.openConnection();
		MySQLFactory f = new MySQLFactory(conn);
		CityRecord c = f.newRecord(CITY);
		c.setCityname("TestStadt");
		c.setPostcode(1234);
		c.store();
		db.releaseConnection(conn);
		db.terminate();
	}
}
